#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
class Solution {
public:
    bool isPalindrome(string s) 
    {
        string a;
        for(int i=0;i<s.size();i++)
        {
            if(s[i]>='A'&&s[i]<='Z')
              a+=s[i]+32;
            if(s[i]>='a'&&s[i]<='z')
              a+=s[i];
            if(s[i]>='0'&&s[i]<='9')
              s+=s[i];
        }
        s=a;
        reverse(a.begin(),a.end());
        if(s!=a)
          return false;
        else 
          return true;
    }
};
int main()
{
  Solution d;
  bool ret=d.isPalindrome("A man, a plan, a canal: Panama");
  cout<<ret<<endl;
  return 0;
}
